<template>
  <div>
    <!--@keydown是键盘捕获  -->
   用户名: <input @keydown="fn" type="text"><br>
   密码  :<input @keydown.13="fn1" type="text"><br>
      密码:<input @keydown.esc="fn2" type="text">
  </div>
</template>

<script>
export default {
  name: 'VueDemoApp',

  data() {
    return {
      
    };
  },
methods:{
  fn(){
    console.log('按下');
  },
   fn1(){
console.log('回车');
  },
  fn2(){
console.log('esc');
  }
}
 
};
</script>

<style lang="scss" scoped>

</style>